import { createApp } from 'vue'
import './style.css'
import App from './App.vue'

// 引入Element Plus及样式
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// 引入Element Plus中文语言包
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
// 引入Element Plus图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

// 引入Vue Router
import router from './router'

// 引入Pinia
import pinia from './store'

// 创建应用
const app = createApp(App)

// 注册Element Plus图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 安装插件
app.use(ElementPlus, {
  locale: zhCn
})
app.use(router)
app.use(pinia)

// 挂载应用
app.mount('#app')
